<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.entity.Article,com.dao.UsersDAO,com.entity.Users"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>主页</title>

	</head>


	<body>
		<center>
			<table width="778" height="600" border="0" cellspacing="0"
				cellpadding="0" bgcolor="#F0EAED" style="word-break: break-all">
				<tr height="281">
					
				</tr>
				<tr>
					
					<td width="548" align="center" valign="top">
						<!-- 显示 我的文章 -->
						<table border="0" width="94%" rules="none" cellspacing="0"
							cellpadding="8" style="margin-top: 8">
							<tr height="40">
								<td>
									【我的文章】
								</td>
								<td align="right">
									<a href="front/article/ArticleIndex.jsp">更多..</a>
								</td>
							</tr>
							
							<tr height="100">
								<td align="center">
									<li>
										博主目前还未发表任何文章！
									</li>
								</td>
							</tr>
							<%
			List<Article> article = (List<Article>) request
					.getAttribute("article");
		%>
		<%
			UsersDAO usersDAO = new UsersDAO();
			for (Article a : article) {
				int user_id = a.getUser_id();
				Users users = usersDAO.findById(user_id);
				String user_name = users.getUser_name();
				String content = a.getArticle_content();
		%>
		<div class="entry-body nerr">
			<h3 align="center"><%=a.getArticle_name()%></h3>
			<P><%=a.getArticle_content()%></P>
		</div>
		<%
			}
		%>
							
						</table>
						<!-- 显示 我的照片 -->
						<table border="0" width="94%" rules="none" cellspacing="8"
							style="margin-top: 10">
							<tr height="40">
								<td colspan="2">
									【我的相册】
								</td>
								<td colspan="2" align="right">
									<a href="PhotoServlet?action=list">更多..</a>
							</tr>
							
						</table>
					</td>
				</tr>
				<tr height="100">
				</tr>
			</table>
		</center>

	</body>
</html>
